package composite;

import java.util.List;

public class Demo {
    public static void main(String[] args) {
        Employee ceo = new Employee("王总", "总裁", 10000);
        Employee employee1 = new Employee("小张", "程序员", 5000);
        Employee employee2 = new Employee("小李", "架构师", 8000);
        ceo.add(employee1);
        ceo.add(employee2);
        List<Employee> list = ceo.getSubordinates();
        for (Employee employee : list) {
            System.out.println(employee);
        }
    }
}
